Context dependent execution time prediction for redirecting queries

ABSTRACT

Context dependent execution time prediction may be applied to redirect queries to additional query processing resources. A query to a database may be received at a first query engine. A prediction model for executing queries at the first query engine may be applied to determine predicted query execution time for the first query engine. A prediction model for executing queries at a second query engine may also be applied to determine predicted query execution time for the second query engine. One of the query engines may be selected to perform the query based on a comparison of the predicted query execution times.

BACKGROUND

As the technological capacity for organizations to create, track, and retain information continues to grow, a variety of different technologies for managing and storing the rising tide of information have been developed. Database systems, for example, provide clients with many different specialized or customized configurations of hardware and software to manage stored information. However, the increasing amounts of data that organizations must store and manage often correspondingly increases both the size and complexity of data storage and management technologies, like database systems, which in turn escalate the cost of maintaining the information. New technologies more and more seek to reduce both the complexity and storage requirements of maintaining data while simultaneously improving the efficiency of data processing.

For example, data processing is often measured by the speed at which requests to access data are performed. Some types of data access requests require intensive computational and storage access workloads, while other types of data access requests may only involve small amounts of work to process. As data stores may have to process both high and low workload access requests, techniques to perform the different types of access requests may be implemented so that access request processing is optimally performed.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a logical block diagram of context dependent execution time prediction for redirecting queries, according to some embodiments.

FIG. 2 is a logical block diagram illustrating a provider network offering data processing services that implement burst performance of database queries according to context dependent execution time prediction for redirecting queries, according to some embodiments.

FIG. 3 is a logical block diagram of a data warehouse service implementing primary and burst processing clusters that utilize a format independent data processing service to perform sub-queries to remote data via query engines hosted in a format independent data processing service, according to some embodiments.

FIG. 4 is a logical block diagram illustrating a format independent data processing service, according to some embodiments.

FIG. 5 is a logical block diagram illustrating an example primary processing cluster of a data warehouse service that implements a burst manager, according to some embodiments.

FIG. 6 is a logical block diagram illustrating an example burst processing cluster of a data warehouse service using a format independent data processing service to perform queries sent to the burst processing cluster, according to some embodiments.

FIG. 7 is a logical block diagram illustrating an example of burst processing management at a primary cluster of a data warehouse service, according to some embodiments.

FIG. 8 is a logical block diagram illustrating example interactions to obtain and release a burst processing cluster from a pool of burst processing clusters, according to some embodiments.

FIG. 9 is a high-level flowchart illustrating methods and techniques to implement context dependent execution time prediction for redirecting queries, according to some embodiments.

FIG. 10 is a high-level flowchart illustrating methods and techniques to implement evaluating predicted execution time ranges to implement context dependent execution time prediction for redirecting queries, according to some embodiments.

FIGS. 11A-11C are examples of predicted execution time ranges for evaluation, according to some embodiments.

FIG. 12 illustrates an example system that implements the various methods, techniques, and systems described herein, according to some embodiments.

While embodiments are described herein by way of example for several embodiments and illustrative drawings, those skilled in the art will recognize that embodiments are not limited to the embodiments or drawings described. It should be understood, that the drawings and detailed description thereto are not intended to limit embodiments to the particular form disclosed, but on the contrary, the intention is to cover all modifications, equivalents and alternatives falling within the spirit and scope as defined by the appended claims. The headings used herein are for organizational purposes only and are not meant to be used to limit the scope of the description or the claims. As used throughout this application, the word “may” is used in a permissive sense (i.e., meaning having the potential to), rather than the mandatory sense (i.e., meaning must). Similarly, the words “include,” “including,” and “includes” mean including, but not limited to.

It will also be understood that, although the terms first, second, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first contact could be termed a second contact, and, similarly, a second contact could be termed a first contact, without departing from the scope of the present invention. The first contact and the second contact are both contacts, but they are not the same contact.

DETAILED DESCRIPTION OF EMBODIMENTS

Various embodiments of context dependent execution time prediction for redirecting queries, according to some embodiments are described herein. Queries for data that satisfies various conditions or criteria, insertions, deletions, modifications, or any other request triggering processing based on a request to access a data store may utilize various processing resources, including various central processing units (CPUs), graphical processing units (GPUs), or other processing components that may execute various tasks to process database queries, in some embodiments. Because database queries may vary in terms of the workload placed upon the processing resources to execute the database query, in some embodiments, the amount of processing resources that any one query engine may provide could be inadequate (or underutilized) to meet the demands of some query workloads, in various embodiments.

For example, a query engine could be optimally sized to perform short, quick or other small-sized queries that are performed with a client system expectation that a result of the query will be returned quickly. Long-running, slow, or other large-sized queries may not perform as efficiently at the same query engine (e.g., as it may not be distributed amongst a large number of nodes in a distributed query processing platform like the clusters described below with regard to FIGS. 2-8). Therefore, additional or other burst capacity provided by an additional query engine (or multiple query engines) may be used to handle increases in workload from database queries or other queries that could be more optimally performed using a different query engine, in some embodiments.

While adding additional query engines can increase number of concurrent queries to a database without adversely affecting resource utilization on a single query engine, the behavior of different query engines for the same queries may not be the same (and thus a prediction of query execution time may also be different for the same query at different query engines). For example, a second query engine could utilize a different source for the database data, such as by using a local copy that is updated from the primary query engine or using cached or backup copy stored in a separate data store (e.g., database data stored in an object store and accessed via a separate data processing service as discussed below with regard to FIG. 6), whereas a primary or main query engine could access database data differently (e.g., on local disks collocated with the primary query engine. Furthermore, query engines may utilize different numbers of nodes (e.g., in a distributed processing cluster like in FIGS. 5 and 6) so that some queries running on a secondary cluster may be slower than the same query on a larger main cluster, whereas in a reverse configuration the opposite performance result may be occur. There are also differences in query engines that receive queries for burst processing so that not all queries may run faster on all secondary query engines (e.g., queries may run faster or slower based on which secondary engine they are routed to).

In some embodiments, queries may not be redirected unless the primary query engine is busy performing other queries and the received queries would wait (e.g., queue) before running. In such embodiments, the queries may benefit from executing on a secondary query engine if they run faster on the secondary query engine when compared to the combined wait time and execution time at the primary query engine, as discussed below with regard to FIG. 10. Further differences can depend upon the configured concurrency, size and hardware types of the systems implementing the query engine and quality of statistics of the primary query engine and lead time to initialize a secondary query engine.

In various embodiments, context dependent execution time prediction for redirecting queries may be implemented to automatically and intelligently choose when to redirect queries to perform a query so that the costs of utilizing the burst resources are not outweighed by its benefits (e.g., providing faster performance for queries to the database overall without increasing resource costs or wasting additional resources), improving the performance of database or other systems that perform queries and improve the utilization of computing resources to perform database queries for a database system overall than would systems that do not incorporate context dependent execution time prediction for redirecting queries.

FIG. 1 illustrates a logical block diagram of context dependent execution time prediction for redirecting queries, according to some embodiments. Query engine 110 may be a query processing platform, application or system of one or multiple components (e.g., a processing cluster as discussed below that includes one or multiple processing nodes or a single node query engine) that can perform queries, such as query 140 to a database, by accessing database data 130, in some embodiments. Database data 130 may be stored or co-located with query engine 110 in some embodiments (e.g., in attached storage as described below in FIG. 5) or may be a separate data store (e.g., network attached storage and/or a separate storage service), in some embodiments. Database data 130 may be stored for various types of databases to which queries may be performed (e.g., relational, non-relational, NoSQL, document, graph, etc.), in some embodiments. FIGS. 3-8, for instance, discuss a data warehouse style database that stores database data, as well as other data stores, such as object-based storage service 330 (which may be general data stores which store data other types or formats of data in addition to database data.) Query engine 110 may operate within execution context 112 (e.g., which may be a different configuration of hardware, software, or other resources for performing a query, including a different number of nodes (in a distributed query engine), different technique for accessing data, difference in hardware capabilities, among other different execution features).

In some embodiments, an additional query engine, such as query engine 120, or multiple additional query engines (not illustrated), may be implemented to perform some queries. Like query engine 110, query engine 120 may be a query processing platform, application or system of one or multiple components (e.g., a processing cluster as discussed below that includes one or multiple processing nodes or a single node query engine) that can perform queries, such as query 140 to a database, by accessing database data 130, in some embodiments. Query engine 120 may be different than query engine 110, in some embodiments (e.g., a different number of nodes, different hardware resources, and/or different engine applications or other query performance components), and thus may operation in a different execution context 122. In some embodiments, query engine 120 may be substantially similar (or the same) as query engine 110.

Query engine 110 may implement context dependent execution time prediction 114 in order to select whether a database query is performed at query engine 110 or another query engine, such as query engine 120. As discussed in detail below with regard to FIGS. 7 and 9-11C, context dependent execution time prediction may provide execution time predictions specific to each query engine according to prediction models trained for each query engine from prior query performance at the query engine. In this way, the differences in execution context are accounted for the in the predicted query execution times used to select a more optimal performance location for a query. Further considerations may be added to or evaluated alongside with the predicted query execution times, such as an initialization time for a secondary query engine or expected wait time at a primary query engine, as discussed below.

Please note that the previous description of a query engine, context dependent execution time prediction, database data, and performance of queries is a logical description and thus is not to be construed as limiting as to the implementation of a query engine, size-based burst performance, database data, and performance of queries, or portions thereof. For example, query engine 120 could return query results 144 to query engine 110, which may then responds to query 140, similar to the interactions discussed below with regard to FIGS. 5 and 6.

This specification begins with a general description of a provider network that implements multiple different services, including data processing services and storage services, which may perform burst performance of database queries according to context-dependent execution time prediction. Then various examples of multiple data processors, such as a data warehouse service and a format independent data processing service, including different components/modules, or arrangements of components/module that may be employed as part of implementing the data processors are discussed. A number of different methods and techniques to implement context dependent execution time prediction for redirecting queries are then discussed, some of which are illustrated in accompanying flowcharts. Finally, a description of an example computing system upon which the various components, modules, systems, devices, and/or nodes may be implemented is provided. Various examples are provided throughout the specification.

FIG. 2 is a logical block diagram illustrating a provider network offering data processing services that implement burst performance of database queries according to context dependent execution time prediction for redirecting queries, according to some embodiments. Provider network 200 may be a private or closed system or may be set up by an entity such as a company or a public sector organization to provide one or more services (such as various types of cloud-based storage) accessible via the Internet and/or other networks to clients 250. Provider network 200 may be implemented in a single location or may include numerous data centers hosting various resource pools, such as collections of physical and/or virtualized computer servers, storage devices, networking equipment and the like (e.g., computing system 2000 described below with regard to FIG. 12), needed to implement and distribute the infrastructure and storage services offered by the provider network 200. In some embodiments, provider network 200 may implement various computing resources or services, such as data processing service(s) 210, (e.g., a map reduce service, a data warehouse service, and/or other large scale data processing services or database services), format independent data processing service 220, and data storage services 230 (e.g., object storage services or block-based storage services that may implement a centralized data store for various types of data), and/or any other type of network based services (which may include a virtual compute service and various other types of storage, processing, analysis, communication, event handling, visualization, and security services not illustrated).

In various embodiments, the components illustrated in FIG. 2 may be implemented directly within computer hardware, as instructions directly or indirectly executable by computer hardware (e.g., a microprocessor or computer system), or using a combination of these techniques. For example, the components of FIG. 2 may be implemented by a system that includes a number of computing nodes (or simply, nodes), each of which may be similar to the computer system embodiment illustrated in FIG. 12 and described below. In various embodiments, the functionality of a given system or service component (e.g., a component of data processing service 210, format independent data processing service 220, or data storage service 230) may be implemented by a particular node or may be distributed across several nodes. In some embodiments, a given node may implement the functionality of more than one service system component (e.g., more than one data store component).

Data processing services 210 may be various types of data processing services that perform general or specialized data processing functions (e.g., anomaly detection, machine learning, data mining, big data querying, or any other type of data processing operation). For example, in at least some embodiments, data processing services 210 may include a map reduce service that creates clusters of processing nodes that implement map reduce functionality over data stored in the map reduce cluster as well as data stored in one of data storage services 230. In another example, data processing service(s) 210 may include various types of database services (both relational and non-relational) for storing, querying, and updating data. Such services may be enterprise-class database systems that are highly scalable and extensible. Queries may be directed to a database in data processing service(s) 210 that is distributed across multiple physical resources, and the database system may be scaled up or down on an as needed basis. The database system may work effectively with database schemas of various types and/or organizations, in different embodiments. In some embodiments, clients/subscribers may submit queries in a number of ways, e.g., interactively via an SQL interface to the database system. In other embodiments, external applications and programs may submit queries using Open Database Connectivity (ODBC) and/or Java Database Connectivity (JDBC) driver interfaces to the database system. For instance, data processing service(s) 210 may implement, in some embodiments, a data warehouse service, such as discussed below with regard to FIG. 3 that utilizes another data processing service, such as format independent data processing service 220, to execute portions of queries or other access requests with respect to data that is stored in a remote data store, such as data storage service(s) 230 (or a data store external to provider network 200) to implement distributed data processing for distributed data sets.

Format independent data processing service 220, as discussed in more detail below with regard to FIGS. 3-6, may provide a service supporting many different data or file formats for data stored in a centralized data store, like one (or more) of data storage service(s) 230 including data stored in the file formats supported by data processing service(s) 210. Instead of reformatting (if the format of data in remote storage is not supported by the data processing service(s) 210) and moving data from data storage service(s) 230 into the data processing service(s) 210, format independent data processing service 220 may efficiently read data from data storage service(s) 230 according to the data format in which the data is already stored in data storage service(s) 230. Format independent data processing service 220 may perform requested operations, such as scan operations that filter or project data results, aggregation operations that aggregate data values and provide partial or complete aggregation results, sorting, grouping, or limiting operations that organize or reduce the determined data results from data in data storage service(s) 230 in order to minimize the amount of data transferred out of data storage service(s) 230.

For example, format independent data processing service 220 may execute different operations that are part of a larger query plan generated at a data processing service 210 and provide results to the data processing service 210 by relying upon requests from data processing service(s) 210 to determine the different operations to perform. In this way, format independent data processing service 220 may be implemented as a dynamically scalable and stateless data processing service that is fault tolerant without the need to support complex query planning and execution for multiple different data formats. Instead, format independent data processing service 230 may offer a set of data processing capabilities to access data stored in a wide variety of data formats (which may not be supported by different data processing service(s) 210) that can be programmatically initiated on behalf of another data processing client, such as data processing service 210.

Data storage service(s) 230 may implement different types of data stores for storing, accessing, and managing data on behalf of clients 250 as a network-based service that enables clients 250 to operate a data storage system in a cloud or network computing environment. Data storage service(s) 230 may also include various kinds of object or file data stores for putting, updating, and getting data objects or files. For example, one data storage service 230 may be an object-based data store that allows for different data objects of different formats or types of data, such as structured data (e.g., database data stored in different database schemas), unstructured data (e.g., different types of documents or media content), or semi-structured data (e.g., different log files, human-readable data in different formats like JavaScript Object Notation (JSON) or Extensible Markup Language (XML)) to be stored and managed according to a key value or other unique identifier that identifies the object. In at least some embodiments, data storage service(s) 230 may be treated as a data lake. For example, an organization may generate many different kinds of data, stored in one or multiple collections of data objects in a data storage service 230. The data objects in the collection may include related or homogenous data objects, such as database partitions of sales data, as well as unrelated or heterogeneous data objects, such as audio files and web site log files. Data storage service(s) 230 may be accessed via programmatic interfaces (e.g., APIs) or graphical user interfaces. For example, format independent data processing service 220 may access data objects stored in data storage services via the programmatic interfaces (as discussed below with regard to FIGS. 5-6).

Generally speaking, clients 250 may encompass any type of client that can submit network-based requests to provider network 200 via network 260, including requests for storage services (e.g., a request to query a data processing service 210, or a request to create, read, write, obtain, or modify data in data storage service(s) 230, etc.). For example, a given client 250 may include a suitable version of a web browser, or may include a plug-in module or other type of code module that can execute as an extension to or within an execution environment provided by a web browser. Alternatively, a client 250 may encompass an application such as a database application (or user interface thereof), a media application, an office application or any other application that may make use of data processing service(s) 210, format independent data processing service 220, or storage resources in data storage service(s) 230 to store and/or access the data to implement various applications. In some embodiments, such an application may include sufficient protocol support (e.g., for a suitable version of Hypertext Transfer Protocol (HTTP)) for generating and processing network-based services requests without necessarily implementing full browser support for all types of network-based data. That is, client 250 may be an application that can interact directly with provider network 200. In some embodiments, client 250 may generate network-based services requests according to a Representational State Transfer (REST)-style network-based services architecture, a document- or message-based network-based services architecture, or another suitable network-based services architecture.

In some embodiments, a client 250 may provide access to provider network 200 to other applications in a manner that is transparent to those applications. For example, client 250 may integrate with an operating system or file system to provide storage on one of data storage service(s) 230 (e.g., a block-based storage service). However, the operating system or file system may present a different storage interface to applications, such as a conventional file system hierarchy of files, directories and/or folders. In such an embodiment, applications may not need to be modified to make use of the storage system service model. Instead, the details of interfacing to the data storage service(s) 230 may be coordinated by client 250 and the operating system or file system on behalf of applications executing within the operating system environment. Similarly, a client 250 may be an analytics application that relies upon data processing service(s) 210 to execute various queries for data already ingested or stored in the data processing service (e.g., such as data maintained in a data warehouse service, like data warehouse service 300 in FIG. 3 below) or data stored in a data lake hosted in data storage service(s) 230 by performing federated data processing between the data processing service 210 and format independent data processing service 220 (as discussed below with regard to FIG. 5).

Clients 250 may convey network-based services requests (e.g., access requests to read or write data may be directed to data in data storage service(s) 230, or operations, tasks, or jobs, such as queries, being performed as part of data processing service(s) 210) to and receive responses from provider network 200 via network 260. In various embodiments, network 260 may encompass any suitable combination of networking hardware and protocols necessary to establish network-based-based communications between clients 250 and provider network 200. For example, network 260 may generally encompass the various telecommunications networks and service providers that collectively implement the Internet. Network 260 may also include private networks such as local area networks (LANs) or wide area networks (WANs) as well as public or private wireless networks. For example, both a given client 250 and provider network 200 may be respectively provisioned within enterprises having their own internal networks. In such an embodiment, network 260 may include the hardware (e.g., modems, routers, switches, load balancers, proxy servers, etc.) and software (e.g., protocol stacks, accounting software, firewall/security software, etc.) necessary to establish a networking link between given client 250 and the Internet as well as between the Internet and provider network 200. It is noted that in some embodiments, clients 250 may communicate with provider network 200 using a private network rather than the public Internet. In some embodiments, clients of data processing services 210, format independent data processing service 220, and/or data storage service(s) 230 may be implemented within provider network 200 (e.g., an application hosted on a virtual computing resource that utilizes a data processing service 210 to perform database queries) to implement various application features or functions and thus various features of client(s) 250 discussed above may be applicable to such internal clients as well.

In at least some embodiments, one of data processing service(s) 220 may be a data warehouse service. FIG. 3 is a logical block diagram of a data warehouse service implementing primary and burst processing clusters that utilize a format independent data processing service to perform sub-queries to remote data via query engines hosted in a format independent data processing service, according to some embodiments. A data warehouse service, such as data warehouse service 300, may offer clients a variety of different data management services, according to their various needs. In some cases, clients may wish to store and maintain large of amounts data, such as sales records marketing, management reporting, business process management, budget forecasting, financial reporting, website analytics, or many other types or kinds of data. A client's use for the data may also affect the configuration of the data management system used to store the data. For instance, for certain types of data analysis and other operations, such as those that aggregate large sets of data from small numbers of columns within each row, a columnar database table may provide more efficient performance. In other words, column information from database tables may be stored into data blocks on disk, rather than storing entire rows of columns in each data block (as in traditional database schemes). The following discussion describes various embodiments of a relational columnar database system. However, various versions of the components discussed below as may be equally adapted to implement embodiments for various other types of relational database systems, such as row-oriented database systems. Therefore, the following examples are not intended to be limiting as to various other types or formats of database systems.

In some embodiments, storing table data in such a columnar fashion may reduce the overall disk I/O requirements for various queries and may improve analytic query performance. For example, storing database table information in a columnar fashion may reduce the number of disk I/O requests performed when retrieving data into memory to perform database operations as part of processing a query (e.g., when retrieving all of the column field values for all of the rows in a table) and may reduce the amount of data that needs to be loaded from disk when processing a query. Conversely, for a given number of disk requests, more column field values for rows may be retrieved than is necessary when processing a query if each data block stored entire table rows. In some embodiments, the disk requirements may be further reduced using compression methods that are matched to the columnar storage data type. For example, since each block contains uniform data (i.e., column field values that are all of the same data type), disk storage and retrieval requirements may be further reduced by applying a compression method that is best suited to the particular column data type. In some embodiments, the savings in space for storing data blocks containing only field values of a single column on disk may translate into savings in space when retrieving and then storing that data in system memory (e.g., when analyzing or otherwise processing the retrieved data).

Data warehouse service 300 may be implemented by a large collection of computing devices, such as customized or off-the-shelf computing systems, servers, or any other combination of computing systems or devices, such as the various types of systems 2000 described below with regard to FIG. 12. Different subsets of these computing devices may be controlled by control plane 310. Control plane 310, for example, may provide a cluster control interface to clients or users who wish to interact with the processing clusters 320 managed by control plane 310. For example, control plane 310 may generate one or more graphical user interfaces (GUIs) for storage clients, which may then be utilized to select various control functions offered by the control interface for the processing clusters 320 hosted in the data warehouse service 300. Control plane 310 may provide or implement access to various metrics collected for the performance of different features of data warehouse service 300, including processing cluster performance and the metrics collected with respect to result cache performance for sub-queries by cache management, in some embodiments.

As discussed above, various clients (or customers, organizations, entities, or users) may wish to store and manage data using a data management service. Processing clusters may respond to various requests, including write/update/store requests (e.g., to write data into storage) or queries for data (e.g., such as a Server Query Language request (SQL) for particular data), as discussed below with regard to FIG. 5, along with many other data management or storage services. Multiple users or clients may access a processing cluster to obtain data warehouse services. In at least some embodiments, a data warehouse service 300 may provide network endpoints to the clusters which allow the clients to send requests and other messages directly to a particular cluster. Network endpoints, for example may be a particular network address, such as a URL, which points to a particular cluster. For instance, a client may be given the network endpoint “http://mycluster.com” to send various request messages to. Multiple clients (or users of a particular client) may be given a network endpoint for a particular cluster. Various security features may be implemented to prevent unauthorized users from accessing the clusters. Conversely, a client may be given network endpoints for multiple clusters.

Processing clusters, such as processing clusters 320 and 340, hosted by the data warehouse service 300 may provide an enterprise-class database query and management system that allows users to send data processing requests to be executed by the clusters 320, such as by sending a query to a cluster control interface implemented by the network-based service. Processing clusters 320 may perform data processing operations with respect to data stored locally in a processing cluster, as well as remotely stored data. For example, object-based storage service 330 may be a data storage service 230 implemented by provider network 200 that stores remote data, such as backups or other data of a database stored in a cluster. In some embodiments, database data may not be stored locally in a processing cluster 320 but instead may be stored in object-based storage service 330 (e.g., with data being partially or temporarily stored in processing cluster 320 to perform queries). Queries sent to a processing cluster 320 (or routed/redirect/assigned/allocated to processing cluster(s) 340 from processing cluster(s) 320) may be directed to local data stored in the processing cluster and/or remote data. Therefore, processing clusters may implement local data processing, such as local data processing 322 and 342, (discussed below with regard to FIGS. 5 and 6) to plan and execute the performance of queries with respect to local data in the processing cluster, as well as a remote data processing client, such as remote data processing clients 324 and 344, to direct execution of different sub-queries (e.g., operations determined as part of the query plan generated at the processing cluster 320) that are assigned to format independent data processing service 220 with respect to processing remote database data 332).

In some embodiments, data warehouse service 300 may implement primary clusters 330 and burst cluster pool 350. Primary clusters 330 may be reserved, allocated, permanent, or otherwise dedicated processing resources that store and/or provide access to a database for a client of data warehouse service 300, in some embodiments. Burst cluster pool 350 may be a set of warmed, pre-configured, initialized, or otherwise prepared clusters which may be on standby to provide additional query performance capacity for a primary cluster 330. Control plane 310 may manage burst cluster pool 350 by managing the size of burst cluster pool 350 (e.g., by adding or removing processing clusters 340 based on demand). Control plane 310 may determine the capabilities or configuration (which may be different) of processing cluster(s) 340 in burst cluster pool 350 (e.g., maintaining a number of 10 node clusters, 15 node clusters, 20 node clusters, etc.). Processing clusters 340 in burst cluster pool 350 may be obtained or provisioned for a primary cluster 330, as discussed in detail below with regard to FIG. 8.

As databases are created, updated, and/or otherwise modified, snapshots, copies, or other replicas of the database at different states may be stored separate from data warehouse service 300 in object-based storage service 330, in some embodiments. For example, a leader node, or other processing cluster component, may implement a backup agent or system that creates and store database backups for a database to be stored as database data 332 in object-based storage service 330. Database data 332 may include user data (e.g., tables, rows, column values, etc.) and database metadata (e.g., information describing the tables which may be used to perform queries to a database, such as schema information, data distribution, range values or other content descriptors for filtering out portions of a table from a query, etc.). A timestamp or other sequence value indicating the version of database data 332 may be maintained in some embodiments, so that the latest database data 332 may, for instance, be obtained by a processing cluster in order to perform queries sent for burst query performance.

FIG. 4 is a logical block diagram illustrating a format independent data processing service, according to some embodiments. As noted above in FIG. 2, format independent data processing service 220 may receive requests to perform processing operations with respect to data stored 432 stored in a data storage service (e.g., backup data or other database data, such as other database tables or data that is not stored according to a format, schema, or structure like that of data stored in data warehouse service 300). Processing requests may be received from a client, such as remote data processing client(s) 402 (which may another data processing service 210, like data warehouse service 300 or another data processing client, such as a database engine/cluster or map reduce cluster implemented outside of provider network 200 and communicating with format independent data processing service 220 in order to process queries with respect to data stored within provider network 200 in a data storage service 230 or to process data stored outside of provider network 200 (when the data is made accessible to format independent data processing service 220).

Format independent data processing service 220 may implement a control plane 410 and multiple processing node(s) 420 to execute processing requests received from remote data processing client(s) 402. Control plane 410 may arbitrate, balance, select, or dispatch requests to different processing node(s) 420 in various embodiments. For example, control plane 410 may implement interface 412 which may be a programmatic interface, such as an application programming interface (API), that allows for requests to be formatted according to the interface 412 to programmatically invoke operations. In some embodiments, the API may be defined to allow operation requests defined as objects of code generated at and sent from remote data processing client(s) 402 (based on a query plan generated at remote data processing client(s) 402) to be compiled or executed in order to perform the assigned operations at format independent data processing service 220.

In some embodiments, format independent data processing service 220 may implement load balancing 418 to distribute remote processing requests across different processing node(s) 420. For example, a remote processing request received via interface 412 may be directed to a network endpoint for a load-balancing component of load balancing 418 (e.g., a load balancing server or node) which may then dispatch the request to one of processing node(s) 420 according to a load balancing scheme. A round-robin load balancing, for instance, may be used to ensure that remote data processing requests are fairly distributed amongst processing node(s) 420. However, various other load-balancing schemes may be implemented. As format independent data processing service 220 may receive many remote data processing requests from multiple remote data processing client(s) 402, load balancing 418 may ensure that incoming requests are not directed to busy or overloaded processing node(s) 420.

Format independent data processing service 220 may also implement resource scaling 414. Resource scaling 414 may detect when the current request rate or workload upon a current number of processing node(s) 420 exceeds or falls below over-utilization or under-utilization thresholds for processing nodes. In response to detecting that the request rate or workload exceeds an over-utilized threshold, for example, then resources scaling 414 may provision, spin up, activate, repurpose, reallocate, or otherwise obtain additional processing node(s) 420 to processing received remote data processing requests. Similarly, the number of processing node(s) 420 could be reduced by resource scaling 414 in the event that the request rate or workload of processing node(s) falls below the under-utilization threshold.

Format independent data processing service 220 may also implement failure management 416 to monitor processing node(s) 420 and other components of format independent data processing service 220 for failure or other health or performance states that may need to be repaired or replaced. For example, failure management 416 may detect when a processing node fails or becomes unavailable (e.g., due to a network partition) by polling processing node(s) 420 to obtain health or performance status information. Failure management may initiate shutdown or halting of processing at failing processing node(s) 420 and provision replacement processing node(s) 420.

Processing node(s) 420 may be implemented as separate computing nodes, servers, or devices, such as computing systems 2000 in FIG. 12, to perform data processing operations on behalf of remote data processing client(s) 402. Processing node(s) 420 may implement stateless, in-memory processing to execute processing operations, in some embodiments. In this way, processing node(s) 420 may have fast data processing rates. Processing node(s) 420 may implement client authentication/identification 421 to determine whether a remote data processing client 402 has the right to access data 432 in storage service 430. For example, client authentication/identification 421 may evaluate access credentials, such as a username and password, token, or other identity indicator by attempting to connect with storage service 430 using the provided access credentials. If the connection attempt is unsuccessful, then the data processing node 402 may send an error indication to remote data processing client 402.

Processing node(s) 420 may implement query processing 422 or other features of a query engine which may perform multiple different sub-queries (e.g., processing operations) and support multiple different data formats. For example, query processing 422 may implement separate tuple scanners for each data format which may be used to perform scan operations that scan data 432 and which may filter or project from the scanned data, search (e.g., using a regular expression) or sort (e.g., using a defined sort order) the scanned data, aggregate values in the scanned data (e.g., count, minimum value, maximum value, and summation), and/or group by or limit results in the scanned data. Remote data processing requests may include an indication of the data format for data 432 so that query processing 422 may use the corresponding tuple scanner for data 432. Query processing 422 may, in some embodiments, transform results of operations into a different data format or schema according to a specified output data format in the remote data processing request.

In some embodiments, data 432 may be stored in encrypted or compressed format. Processing node(s) 420 may implement compression engine(s) 424 to decompress data 432 according to a compression technique identified for data 432, such as lossless compression techniques like run-length encoding, Lempel-Ziv based encoding, or bzip based encoding. Processing node(s) 420 may implement encryption engine(s) 426 to decrypt data 432 according to an encryption technique and/or encryption credential, such as a key, identified for data 432, such as symmetric key or public-private key encryption techniques.

Processing node(s) 420 may implement storage access 428 to format, generate, send and receive requests to access data 432 in storage service 430. For example, storage access 428 may generate requests to obtain data according to a programmatic interface for storage service 430. In some embodiments, other storage access protocols, such as internet small computer interface (iSCSI), may be implemented to access data 432.

FIG. 5 is a logical block diagram illustrating an example primary processing cluster of a data warehouse service using a format independent data processing service that implements burst manager, according to some embodiments. Primary processing cluster 500 may be data warehouse service cluster, like processing clusters 320 discussed above with regard to FIG. 3, or another processing cluster that distributes execution of a query among multiple processing nodes. As illustrated in this example, a primary processing cluster 500 may include a leader node 510 and compute nodes 520 a, 520 b, and 520 n, which may communicate with each other over an interconnect (not illustrated). Leader node 510 may implement query planning 512 to generate query plan(s), query execution 514 for executing queries on primary processing cluster 500 that perform data processing that can utilize remote query processing resources for remotely stored data (e.g., by utilizing one or more query execution slot(s)/queue(s) 517) and burst manager 515 for selecting, routing, directing, or otherwise causing a received query to be performed using burst capacity resources, such as a burst processing cluster 600 in FIG. 6 discussed below. As described herein, each node in a primary processing cluster 500 may include attached storage, such as attached storage 522 a, 522 b, and 522 n, on which a database (or portions thereof) may be stored on behalf of clients (e.g., users, client applications, and/or storage service subscribers).

Note that in at least some embodiments, query processing capability may be separated from compute nodes, and thus in some embodiments, additional components may be implemented for processing queries. Additionally, it may be that in some embodiments, no one node in processing cluster 500 is a leader node as illustrated in FIG. 5, but rather different nodes of the nodes in processing cluster 500 may act as a leader node or otherwise direct processing of queries to data stored in processing cluster 500. While nodes of processing cluster may be implemented on separate systems or devices, in at least some embodiments, some or all of processing cluster may be implemented as separate virtual nodes or instance on the same underlying hardware system (e.g., on a same server).

In at least some embodiments, primary processing cluster 500 may be implemented as part of a data warehouse service, as discussed above with regard to FIG. 3, or another one of data processing service(s) 210. Leader node 510 may manage communications with clients, such as clients 250 discussed above with regard to FIG. 2. For example, leader node 510 may be a server that receives a query 501 from various client programs (e.g., applications) and/or subscribers (users), then parses them and develops an execution plan (e.g., query plan(s)) to carry out the associated database operation(s)). More specifically, leader node 510 may develop the series of steps necessary to obtain results for the query. Query 501 may be directed to data that is stored both locally within processing cluster 500 (e.g., at one or more of compute nodes 520) and data stored remotely (which may be accessible by format independent data processing service 220). Leader node 510 may also manage the communications among compute nodes 520 instructed to carry out database operations for data stored in the processing cluster 500. For example, node-specific query instructions 504 may be generated or compiled code by query execution 514 that is distributed by leader node 510 to various ones of the compute nodes 520 to carry out the steps needed to perform query 501, including executing the code to generate intermediate results of query 501 at individual compute nodes may be sent back to the leader node 510. Leader node 510 may receive data and query responses or results from compute nodes 520 in order to determine a final result 503 for query 501. A database schema, data format and/or other metadata information for the data stored among the compute nodes, such as the data tables stored in the cluster, may be managed and stored by leader node 510. Query planning 512 may account for remotely stored data by generating node-specific query instructions that include remote operations to be directed by individual compute node(s). As discussed in more detail below with regard to FIG. 7, a leader node may implement burst manager 515 to send 506 a query plan generated by query planning 512 to be performed at a burst processing cluster and return results 508 received from the burst processing cluster to a client as part of results 503. In this way, burst query processing may occur without client application changes to establish a separate connection or communication scheme with burst processing resources, allowing for seamless scaling between primary and burst processing capacity.

In at least some embodiments, a result cache may be implemented as part of leader node 510. For example, as query results are generated, the results may also be stored in result cache (or pointers to storage locations that store the results either in primary processing cluster 500 or in external storage locations), in some embodiments. The result cache may be used instead of burst capacity, in some embodiments, by recognizing queries which would otherwise be sent to a burst processing cluster to be performed that have results stored in the result cache. Various caching strategies (e.g., LRU, FIFO, etc.) for result cache 519 may be implemented, in some embodiments. Although not illustrated in FIG. 4, a result cache could be stored in other storage systems (e.g., other storage services, such as a NoSQL database) and/or could store sub-query results for requests to format independent data processing service 220 instead of or in addition to full query results).

Processing cluster 500 may also include compute nodes, such as compute nodes 520 a, 520 b, and 520 n. Compute nodes 520, may for example, be implemented on servers or other computing devices, such as those described below with regard to computer system 2000 in FIG. 12, and each may include individual query processing “slices” defined, for example, for each core of a server's multi-core processor, one or more query processing engine(s), such as query engine(s) 524 a, 524 b, and 524 n, to execute the instructions 504 or otherwise perform the portions of the query plan assigned to the compute node. Query engine(s) 524 may access a certain memory and disk space in order to process a portion of the workload for a query (or other database operation) that is sent to one or more of the compute nodes 520. Query engine 524 may access attached storage, such as 522 a, 522 b, and 522 n, to perform local operation(s), such as local operations 518 a, 518 b, and 518 n. For example, query engine 524 may scan data in attached storage 522, access indexes, perform joins, semi joins, aggregations, or any other processing operation assigned to the compute node 520.

Although not illustrated query engine 524 a may also direct the execution of remote data processing operations, by providing remote operation(s to remote data processing clients, similar to the techniques discussed below with regard to FIG. 6. Remote data processing clients may be implemented by a client library, plugin, driver or other component that sends request sub-queries to format independent data processing service 220. As noted above, in some embodiments, format independent data processing service 220 may implement a common network endpoint to which request sub-quer(ies) are directed, and then may dispatch the requests to respective processing nodes. Remote data processing clients may read, process, or otherwise obtain results from processing nodes, including partial results of different operations (e.g., aggregation operations) and may provide sub-query result(s), back to query engine(s) 524, which may further process, combine, and or include them with results of local operations 518.

Compute nodes 520 may send intermediate results from queries back to leader node 510 for final result generation (e.g., combining, aggregating, modifying, joining, etc.). Remote data processing clients 526 may retry sub-query request(s) 532 that do not return within a retry threshold. As format independent data processing service 220 may be stateless, processing operation failures at processing node(s) 540 may not be recovered or taken over by other processing nodes 540, remote data processing clients may track the success or failure of requested operation(s), and perform retries when needed.

Attached storage 522 may be implemented as one or more of any type of storage devices and/or storage system suitable for storing data accessible to the compute nodes, including, but not limited to: redundant array of inexpensive disks (RAID) devices, disk drives (e.g., hard disk drives or solid state drives) or arrays of disk drives such as Just a Bunch Of Disks (JBOD), (used to refer to disks that are not implemented according to RAID), optical storage devices, tape drives, RAM disks, Storage Area Network (SAN), Network Access Storage (NAS), or combinations thereof. In various embodiments, disks may be formatted to store database tables (e.g., in column oriented data formats or other data formats).

FIG. 6 is a logical block diagram illustrating an example burst processing cluster of a data warehouse service using a format independent data processing service to perform queries sent to the burst processing cluster, according to some embodiments. Similar to primary processing cluster 500 in FIG. 5, burst processing cluster 600 may include a leader node 610 and compute nodes 620 a, 620 b, and 620 n, which may communicate with each other over an interconnect (not illustrated). Leader node 610 may implement query execution 612 for executing queries on burst processing cluster 600. For example, leader node 610 may receive a query plan 602 to perform a query from a primary processing cluster. Query execution 612 may generate the instructions or compile code to perform the query according to the query plan. Leader node 610 may also manage the communications among compute nodes 620 instructed to carry out database operations for data stored in the burst processing cluster 600. For example, node-specific query instructions 604 may be generated or compiled code by query execution 612 that is distributed by leader node 610 to various ones of the compute nodes 620 to carry out the steps needed to perform query plan 602, including executing the code to generate intermediate results of the query at individual compute nodes may be sent back to the leader node 610. Leader node 610 may receive data and query responses or results from compute nodes 620 in order to determine a final result 606 for the query to be sent back to the primary processing cluster.

In at least some embodiments, burst processing cluster 600 may not maintain a local copy of the database, but instead may access a backup of the database (or the database directly which may not be maintained locally at primary processing clusters) via format independent data processing service 220. For example, query engine 624 a may direct the execution of remote data processing operations, by providing remote operation(s), such as remote operations 616 a, 616 b, and 616 n, to remote data processing clients, such as remote data processing client 626 a, 626 b, and 626 n, in order to retrieve data from the database data in object storage service 330 to perform the query. As noted earlier, remote data processing clients 626 may be implemented by a client library, plugin, driver or other component that sends request sub-queries, such as sub-quer(ies) 632 a, 632 b, and 632 n to format independent data processing service 220. As noted above, in some embodiments, format independent data processing service 220 may implement a common network endpoint to which request sub-quer(ies) 632 are directed, and then may dispatch the requests to respective processing nodes, such as processing nodes 640 a, 640 b, and 640 n. Remote data processing clients 626 may read, process, or otherwise obtain results from processing nodes, including partial results of different operations (e.g., aggregation operations) and may provide sub-query result(s), including result(s) 634 a, 634 b, and 634 c, back to query engine(s) 624, which may further process, combine, and or include them with results of location operations 618. In at least some embodiments, processing nodes 640 may filter, aggregate, or otherwise reduce or modify data from the database backups used to perform the query in order to lessen the data transferred and handled by burst processing cluster 600, increasing the performance of the query at burst processing cluster 600. Although not illustrated in FIG. 6, some burst processing clusters may implement local attached storage and local processing similar to primary processing cluster 500 in FIG. 5. For example, a burst processing cluster that was scheduled for a period of time that exceeds some threshold value (e.g., greater than 1 hour) may read and store in persistent storage database data from the database data (e.g., directly or via format independent data processing service 220), in some embodiments.

Although not illustrated in FIGS. 5 and 6, further communications between a primary processing cluster and burst processing cluster may be implemented. For example, database metadata may be obtained at burst processing cluster 600 from a database backup and then updated as updates are made at the primary processing cluster, in some embodiments, as discussed below with regard to FIG. 8. In some embodiments, compute nodes 620 (or leader node 610) may request data directly from compute nodes 520 in primary processing cluster 500), such as updated data blocks in a table of a database. In at least one embodiment, all of the data used to perform a query may be obtained by compute nodes 620 from compute nodes 520 instead of utilizing format independent data processing service 220 and a backup in a separate data store.

In at least some embodiments, burst processing cluster 600 may be a single tenant resource, only performing burst queries for one database (or client or user account). In some embodiments, burst processing cluster 600 may be a multi-tenant environment, handling burst queries for different databases, different user accounts and/or different clients. In such scenarios, security techniques to prevent data from being visible to unauthorized users may be implemented.

FIG. 7 is a logical block diagram illustrating an example of burst processing management at a primary cluster of a data warehouse service, according to some embodiments. Leader node 700 may be similar to leader node 510 in FIG. 5. Leader node 700 may implement query planner 710 to handle a received database query 702. For example, query planner 710 may perform various query planning techniques, such as generating a parse tree from a query statement, applying various rewrites or rules-based optimizations to modify the parse tree (e.g., reordering different operations such as join operations), generating different plans for performing the parsed/modified tree, and applying cost estimation techniques to determine estimated costs of the different plans in order to select a least costly plan as the query plan 712 to perform query 702.

As illustrated in FIG. 5, burst manager 730 may be implemented by leader node to select the cluster to perform database query 702, in some embodiments. For example, burst manager 730 may implement a primary cluster execution time classifier 740, a burst cluster execution time classifier 720, and an expected wait time calculator 780. Primary cluster execution time classifier 740 may be trained from primary cluster history 742 (e.g., using either online or offline training techniques) to determine a prediction model for classifying execution time of queries at the primary cluster. Burst cluster execution time classifier 720 may be trained from burst cluster history 722 (e.g., using either online or offline training techniques) to determine a prediction model for classifying execution time of queries at the burst cluster. For example, supervised learning algorithms, such as linear (e.g., linear regression) or non-linear algorithms (e.g., decision tree (random forest) and K nearest neighbor) may be used to determine which features of a query indicate that it may be included in a predicted range of execution time and may be used to train classifiers 720 and 740 (although unsupervised techniques could be implemented as well). For example, burst cluster history 722 may be gathered by storing query plans and associated execution times measured for the queries of the query plans performed at the burst cluster (or burst clusters of a similar configuration) to train burst cluster execution time classifier 720. Similarly, burst manager 730 may track the execution time associated with query plans performed by the primary cluster to train primary cluster execution time classifier. Training components may be implemented as part of burst manager 730 (not illustrated) in order to generate models for classifiers 720 and 740. In other embodiments, external resources (e.g., a training system or service implemented as part of provider network 200 may receive the cluster history for primary and burst clusters, generate respective models and provide them to burst manager 730.

Expected wait time calculator 780 may account for currently pending or queued queries at the primary processing cluster in order to determine an expected time from which a query execution slot may become available to perform the query. For example, query execution slot(s)/queue(s) 760 may be maintained as part of leader node 700, in some embodiments. Query execution slot(s)/queue(s) 760 may, in some embodiments, be implemented as part of a queue (not illustrated). A query execution slot, such as query execution slots 766 a, 766 b, 766 c, 768 a, 768 b, and 768 c, may identify a process that is allocated a certain portion of computing resources at a processing cluster (e.g., processor, memory, I/O bandwidth, network bandwidth, etc.) to perform a query assigned to that slot. As illustrated in FIG. 7, some query execution slots may be reserved 764 for queries identified according to a query size (e.g., “small” queries). A minimum number of query execution slots in reserved short query execution resources 764, such as execution slots 768, may be maintained so that only queries identified as of the appropriate size (e.g., “small”) can be performed on the reserved slots 768. Other slots, such as slots 762, may remain available for general query execution (e.g., execution of queries of all sizes), in some embodiments.

As discussed below with regard to FIG. 10, in some embodiments, expected wait time calculator may apply a Markov decision process that may be used to estimate an expected time till a free slot can be made available to perform the query. For example, the number of filled and available execution slots can be used to model different states in the Markov decision process that selects queued queries according to a scheduling technique (e.g., shortest job first, FIFO, LIFO, etc.). The queries for the Markov decision process may be identified that have the same predicted range of execution time as the query (as discussed below with regard to element 1030). A cumulative distribution function may be applied to the identified queries and the result of the cumulative distribution function may bused in the Markov decision process to estimate an expected time to a free slot for the query, and thus the expected wait time for the query.

Query size 742 may be provided to cluster selection 750, in some embodiments. Cluster selection 750 may apply different techniques for comparing or evaluating the predicted execution time ranges 746 and expected wait time 782, as discussed in detail below with regard to FIGS. 10-11C.

Cluster selection 750 may direct the query for local query execution 754, in some embodiments. Primary cluster query execution 770 may generate the instructions and/or code to perform the query, as discussed above (e.g., like query execution 514). Alternatively, cluster selection 750 select a burst processing cluster to perform the query, and provide a request, instruction, or other indication to perform burst query execution 752, in some embodiments. In at least some embodiments, further query planning to adapt the query plan to the burst cluster may be performed (not illustrated). For example, the number of nodes in the burst processing cluster may be different, which may result in a different division of work in the query plan. Instructions may also be included for accessing data through format independent data processing service 220 (e.g., storage object locations, access credentials, including specialized operators or instructions to leverage format independent data processing service 220 in the plan), in some embodiments.

In at least some embodiments, burst manager 730 may be configured via user and/or control plane requests. For example, as discussed below with regard to FIG. 8, events that trigger the request for a burst processing cluster may be specified (e.g., scheduled time periods that a burst cluster may be active, the level of utilization of query execution slot(s)/queue(s) 760 before using a burst cluster, to enable/disable predictive burst processing which may allow burst manager 730 to perform time series or other types of analysis to determine when burst capacity may be needed for a database and preemptively obtain burst processing cluster(s) to meet the determined need), in some embodiments. In some embodiments, burst configuration 780 may be performed as part of other workload management interfaces or settings for a database or primary processing cluster. For example, some query execution slots or queues may be identified as non-burstable (e.g., so that a query cannot be removed from the queue/slot and sent to the burst processing cluster instead). Bursting could be enabled/disabled for specified users/applications, in some embodiments, via burst configuration 780.

In at least some embodiments, burst configuration 780 may allow users (or the control) to specify via an interface when burst performance of queries may be enabled or disabled for a primary processing cluster. For example, burst can be enabled/disabled automatically in order to optimize for cost or performance, in some embodiments. A maximum queue time or other performance criteria for the primary processing cluster could be specified as part of a burst configuration for queries, for instance, may determine when bursting should occur (e.g., if queries would exceed the queue time then begin using bust capacity). In some embodiments, a burst budget (e.g., a cost limitation for using burst processing clusters) or other limitation may be specified as part of burst configuration in order to allow a user/client application to indicate when burst should stop so that the budget or other limitation is not exceeded (e.g., for a given time period, such as a day, week, month, etc.).

FIG. 8 is a logical block diagram illustrating example interactions to obtain and release a burst processing cluster from a pool of burst processing clusters, according to some embodiments. Burst manager 812 at leader node 810 may detect or determine when to obtain a burst cluster for performing queries in various scenarios, as discussed below with regard to FIG. 11. Burst manager 812 may then request a burst cluster 842 from control plane 310. The request may, in some embodiments, specify a type of burst cluster. In some embodiments, control plane 310 may evaluate a manifest, index, or other data that describes available processing cluster(s) 822 in burst cluster pool 820 in order to satisfy the request. For example, control plane 310 may identify a processing cluster that matches (or best matches) the specified configuration of the burst cluster request, in some embodiments. In some embodiments, control plane 310 may identify a burst cluster that was previously used for performing queries to the database hosted by the cluster of leader node 810.

Control plane 310 may provision 844 the burst cluster, in some embodiments, from burst cluster pool, such as provisioned burst cluster 824. Provisioning a burst cluster may include various operations to configure network connections between provisioned processing cluster for burst capacity 824 and leader node 810 and other services (e.g., format independent data processing service 220, object storage service 330, etc.). In some embodiments, access credentials, security tokens, and/or encryption keys may be provided so that provisioned processing cluster for burst capacity 824 can access and database data to perform queries for the database. In some embodiments, initialization procedures, workflows or other operations may be started by control plane 310 at provisioned processing cluster for burst capacity 824. For example, provisioned processing cluster for burst capacity 824 may get metadata 848 from object-based storage service 330 that is stored as part of database metadata 830 in a database backup in order to perform queries to the database. In some embodiments, provisioned processing cluster for burst capacity 824 may get metadata updates 850 directly from leader node 810 (or other nodes in a primary processing cluster) in order to catch up the metadata to account for changes that occurred after the backup was stored. Control plane 310 may track the time to complete provisioning or otherwise initialize provisioned processing cluster 824 as well as for other provisioned burst clusters. The initialization times may be averaged and included in an evaluation of predicted execution times, as discussed below with regard to FIG. 9.

Once provisioning is complete, provisioned processing cluster for burst capacity 824 may be made available for performing queries. Control plane 310 may identify the burst cluster 846 to leader node 810 (e.g., by providing a network endpoint for provisioned cluster 824), in some embodiments. Leader node 810 may then begin directing selected queries 852 to provisioned cluster 824, which may perform the queries and send back query results 854 to leader node 810, which may provide the results to a client in turn. In this way, a client application does not have to learn of and receive requests from a second location, provisioned cluster 824 when burst performance is used, in some embodiments.

When an event that triggers release of the burst cluster occurs, burst manager 812 may send a request to control plane 310 to release the burst cluster 856 (e.g., by including the identifier of the provisioned cluster 824). Control plane 310 may then delete the burst cluster 858 (e.g., by removing/deleting data and/or decommissioning/shutting down the host resources for the provisioned cluster 824).

Although FIGS. 2-8 have been described and illustrated in the context of a provider network implementing different data processing services, like a data warehouse service, the various components illustrated and described in FIGS. 2-8 may be easily applied to other data processing systems that can utilize additional query engines to receive redirected queries. As such, FIGS. 2-8 are not intended to be limiting as to other embodiments of context dependent execution time prediction for redirecting queries.

FIG. 9 is a high-level flowchart illustrating methods and techniques to implement context dependent execution time prediction for redirecting queries, according to some embodiments. Various different systems and devices may implement the various methods and techniques described below, either singly or working together. Different combinations of services implemented in different provider networks operated by different entities may implement some or all of the methods (e.g., a data warehouse cluster in a service of a first provider network, an intermediate data processing service in a second provider network, and a data set stored in a service of a third provider network). Different types of query engines or non-distributed query performance platforms may implement these techniques. Alternatively, various other combinations of different systems and devices located within or without provider networks may implement the below techniques. Therefore, the above examples and or any other systems or devices referenced as performing the illustrated method, are not intended to be limiting as to other different components, modules, systems, or devices.

As indicated at 910, a database query may be received, in various embodiments. The database query may be received according to various interfaces, formats, and/or protocols. For example, the database query may be formatted according to a query language such as Structured Query Language (SQL), in some embodiments, or may be specified according to an Application Programming Interface (API) for receiving queries. In at least some embodiments, the database query may be one query of many queries that can be submitted by one or many different users to a same database engine, processing platform, or system. For example, the database query may compete for computing resources along with other queries received from other users to be executed with respect to a database in some embodiments. In at least some embodiments, the query may be received at the first query engine (e.g., received at a primary processing cluster as discussed above with regard to FIGS. 5-7). In other embodiments, the query may be received at another query engine or at a request router.

As indicated at 920, a first prediction model for the first query engine trained according to past query performance at the first query engine to determine a first execution time prediction for the query at the first query engine, in some embodiments. For example, as discussed above with regard to FIG. 7, a prediction model may be generated according to various machine learning to techniques to classify a query's execution time at the first query engine. A query plan for the query (e.g., generated by a query planner and/or optimizer) may be used as the features or inputs to the prediction model in order to determine an execution time. A predicted execution time could be a single value (e.g., 5 minutes) or a range of execution times, as discussed in detail below with regard to FIG. 10. Other features, inputs, or variables may be added to (or evaluated with) the predicted execution time, such as predicted resource utilization, predicted network transmission performance, or a predicted wait time for the query, as discussed above in FIG. 7 and below in FIG. 10.

As indicated at 930, a first prediction model for the first query engine trained according to past query performance at the first query engine to determine a first execution time prediction for the query at the first query engine, in some embodiments. Like the discussion above with regard to element 920, a prediction model may be generated according to various machine learning to techniques to classify a query's execution time at the first query engine. A query plan for the query (e.g., generated by a query planner and/or optimizer) may be used as the features or inputs to the prediction model in order to determine an execution time. A predicted execution time could be a single value (e.g., 5 minutes) or a range of execution times, as discussed in detail below with regard to FIG. 10. Other features, inputs, or variables may be added to (or evaluated with) the predicted execution time, such as predicted resource utilization, predicted network transmission performance, or a predicted initialization time to prepare the secondary query engine for accepting the query, as discussed above in FIG. 7 and below in FIG. 10. Because the query engines may be implemented in different contexts (e.g., different underlying hardware, different techniques for accessing database data, different features of performance (e.g., initialization vs. waiting)), in at least some embodiments, the features considered along or included with the predicted execution time for the query engines may differ.

As indicated at 940, a comparison between the second execution time prediction and the first execution time prediction may be performed. For example, a single value comparison (e.g., 5 minutes to 3 minutes may be performed). As noted above, in some embodiments, additional features may be included to adjust or modify the execution times (e.g., increasing predicted execution time values as a result of a high predicted memory or network utilization, adding predicted wait time or initialization time to the predicted execution time values, and so on). In some embodiments, multiple secondary query engines may be available and thus a predicted execution time for may be determined for each one (as discussed above at element 730, and the resulting predictions may be used to filter, select, or choose the query engine to be the second query engine compared with the first query engine (e.g., the query engine with the lowest predicted execution time).

If the second execution time prediction is less than the first execution time prediction, then as indicated at 950 the query may be performed at the second query engine. For example, as discussed above in FIG. 5, a query may be forwarded on to the second query engine, along with a query plan. In other embodiments, the query alone may be sent and a different query plan for the query may be determined at the second query engine. The query may be performed at the second query engine using local and/or remote copies of the database (e.g., via a format independent data processing service), in some embodiments.

If the second execution time prediction is not less than the first execution time prediction, then as indicated at 960, the query may be performed at the first query engine. Various scheduling techniques for queries at the first query engine may take advantage of the predicted execution time for the query at the first query engine (e.g., in order to order query performance based on execution time), in some embodiments.

As noted above, a predicted range of execution time for a query may be determined when applying a prediction model to a query for different query engines. FIG. 10 is a high-level flowchart illustrating methods and techniques to implement evaluating predicted execution time ranges to implement context dependent execution time prediction for redirecting queries, according to some embodiments. As indicated at 1010, an expected wait time (referred to herein as “E”) may be determined for a query received at a first query engine, in some embodiments. For example, an expected wait time may be determined in one or more phases. If no queries are queued, held, or otherwise waiting to be performed by a query engine, then an E may be an expected wait time of zero. If, however, a query is queued, held, or otherwise waiting, then a non-zero expected wait time may be determined.

To predict an expected wait time, various techniques may be implemented. For example, in one technique the predicted execution times of previously recited queries that are determined when the queries are received may be summed up. In embodiments where multiple execution slots are implemented for performing queries in parallel (as discussed above with regard to FIG. 7, then summation of predicted execution times may be modified according to the number of execution slots (e.g., divided by the number of execution slots). In some embodiments, a Markov decision process may be used to estimate an expected time till a free slot can be made available to perform the query. For example, the number of filled and available execution slots can be used to model different states in the Markov decision process that selects queued queries according to a scheduling technique (e.g., shortest job first, FIFO, LIFO, etc.). The queries for the Markov decision process may be identified that have the same predicted range of execution time as the query (as discussed below with regard to element 1030). A cumulative distribution function may be applied to the identified queries and the result of the cumulative distribution function may bused in the Markov decision process to estimate an expected time to a free slot for the query, and thus the expected wait time for the query.

As indicated at 1020, if E is no greater than zero, then the query may be performed at the first query engine (as no other work is being performed that would cause a wait for the query). If E is greater than zero, then other analysis may be performed.

For example, as indicated at 1030, a predicted range of execution time (R₁) may be determined for the query at the first query engine, in some embodiments. For example, the execution plan of the query as determined by a query planner and/or optimizer may be evaluated. The plan may include various operations a query has to perform like select, join aggregation etc. and also the amount of work done by each operator (e.g., a time or other cost value). An execution time prediction model may take this plan as an input and converts it into a vector of feature values, which when compared with the feature values of different ranges of predicted execution time may be identified with the closest or most similar range of execution time, in some embodiments. In some embodiments, feature values may include the number of operators of each type of operators (e.g., number of selects, joins, aggregations, etc.) and a summary of the work done. Consider if the plan were to have 5 join operators and each join operators may work on 1 gigabyte data. In such a scenario, the feature value vector for join operators may include both 5 and 5 GB (5*1 GB) in addition to similar values for other operators.

In various embodiments, the prediction model may classify or otherwise determine according to different ranges of execution time (which may be non-overlapping), such as ranges of execution time from 1 second to 10 seconds, 100 seconds to 100 seconds, 100 seconds to 1,000 seconds and so on). In some embodiments, the different ranges may be determined by considering exponentially increasing percentile execution time of a workload, such as a 1 second may correspond to 50th percentile (P50) of execution times, 10 second to P75 (P50 of rest 50% of the queries), 100 s to P87.5 (P50 of the rest 25% queries) and so on. In this way, queries may be redirected to additional query engines in a way to scale to vastly different execution time of queries on different clusters. In addition, it gives more accurate results as compared to linearly constructed buckets (P25, P50, P75, P100, etc.). Thus, in some embodiments, R₁ may be determined according to which range of execution time is determined for the query.

As indicated 1040, a predicted range of execution time (R₂) may be determined for the query at the second query engine, in some embodiments. Like the discussion above with regard to the predicted range of execution time R1 for a query engine at element 1030, the execution plan for the query may be evaluated to determine a feature vector for input to an execution time prediction model, which may indicate one of a different execution time ranges as the predicted execution time range. As the prediction model may account for a different execution context of the second query engine than the execution context of the first query engine, the prediction model and/or classification technique applied for the second query engine may be different than the prediction model and/or classification.

Different combinations of predicted execution ranges and E may be considered. For example, as indicated at 1050, if the minimum value of R₁ added to the expected wait time E is greater than the maximum value of R₂, then the query may be performed at the second query engine, as indicated at 1090. For example, FIG. 11A, illustrates such a comparison. First query engine 1110 may have a minimum value R₁ 1112 added to E 1114 as a total execution time. The minimum value of R₁ may be the lowest value within the range of execution time values (e.g., 10,000 to 10,500, where R₁=10,000). Second query engine 1120 may have a maximum value of R₂ that while larger than the minimum value of R₁ on its own, is less than the total execution value at first query engine 1110. The maximum value of R₂ may be the highest value within the range of execution time values (e.g., 15,000 to 15,500, where R₂=15,500).

If the minimum value of R₁ added to the expected wait time E is not greater than the maximum value of R₂, then another evaluation may be performed. As indicated at 1060, if the minimum value of R₁ added to the expected wait time E is less than the maximum value of R₂, then the query may be performed at the first query engine, as indicated by the positive exit from 1060 to 1080. Consider FIG. 11B. First query engine 1130 has a minimum value of R₁ 1132 added to E 1134 that is less than the maximum value R₂ 1142 of second query engine 1140.

In the event that there is a tie between the minimum value of R₁ added to the expected wait time E and the maximum value of R₂ then an evaluation of R₂ compared with some threshold, such as a long query execution time range 1160 in FIG. 11c , may be performed, as indicated at 1070. A long query execution time range may be represented by a threshold range of time after which query should by execute at a secondary cluster. For example, a long query execution time range could keep the first query engine free to do other work while the second query engine performs the query, in some embodiments. As illustrated in FIG. 11C, second query engine 1150 may have a minimum execution time R₂ 1142 that is greater than the long query execution range 1160. If R₂ does not exceed the minimum execution time, then as indicated by the positive exit from 1070 to 1090, the query may be performed at the second query engine. If a second query engine may have a minimum execution time longer than long range query execution time range, then the query may be performed at the first query engine, as indicated by the negative exit from 1070.

The methods described herein may in various embodiments be implemented by any combination of hardware and software. For example, in one embodiment, the methods may be implemented by a computer system (e.g., a computer system as in FIG. 12) that includes one or more processors executing program instructions stored on a computer-readable storage medium coupled to the processors. The program instructions may implement the functionality described herein (e.g., the functionality of various servers and other components that implement the network-based virtual computing resource provider described herein). The various methods as illustrated in the figures and described herein represent example embodiments of methods. The order of any method may be changed, and various elements may be added, reordered, combined, omitted, modified, etc.

Embodiments of context dependent execution time prediction for redirecting queries as described herein may be executed on one or more computer systems, which may interact with various other devices. One such computer system is illustrated by FIG. 12. In different embodiments, computer system 2000 may be any of various types of devices, including, but not limited to, a personal computer system, desktop computer, laptop, notebook, or netbook computer, mainframe computer system, handheld computer, workstation, network computer, a camera, a set top box, a mobile device, a consumer device, video game console, handheld video game device, application server, storage device, a peripheral device such as a switch, modem, router, or in general any type of computing node, compute node, computing device, compute device, or electronic device.

In the illustrated embodiment, computer system 2000 includes one or more processors 1010 coupled to a system memory 1020 via an input/output (I/O) interface 1030. Computer system 2000 further includes a network interface 1040 coupled to I/O interface 1030, and one or more input/output devices 1050, such as cursor control device 1060, keyboard 1070, and display(s) 1080. Display(s) 1080 may include standard computer monitor(s) and/or other display systems, technologies or devices. In at least some implementations, the input/output devices 1050 may also include a touch- or multi-touch enabled device such as a pad or tablet via which a user enters input via a stylus-type device and/or one or more digits. In some embodiments, it is contemplated that embodiments may be implemented using a single instance of computer system 2000, while in other embodiments multiple such systems, or multiple nodes making up computer system 2000, may host different portions or instances of embodiments. For example, in one embodiment some elements may be implemented via one or more nodes of computer system 2000 that are distinct from those nodes implementing other elements.

In various embodiments, computer system 2000 may be a uniprocessor system including one processor 1010, or a multiprocessor system including several processors 1010 (e.g., two, four, eight, or another suitable number). Processors 1010 may be any suitable processor capable of executing instructions. For example, in various embodiments, processors 1010 may be general-purpose or embedded processors implementing any of a variety of instruction set architectures (ISAs), such as the x86, PowerPC, SPARC, or MIPS ISAs, or any other suitable ISA. In multiprocessor systems, each of processors 1010 may commonly, but not necessarily, implement the same ISA.

In some embodiments, at least one processor 1010 may be a graphics processing unit. A graphics processing unit or GPU may be considered a dedicated graphics-rendering device for a personal computer, workstation, game console or other computing or electronic device. Modern GPUs may be very efficient at manipulating and displaying computer graphics, and their highly parallel structure may make them more effective than typical CPUs for a range of complex graphical algorithms. For example, a graphics processor may implement a number of graphics primitive operations in a way that makes executing them much faster than drawing directly to the screen with a host central processing unit (CPU). In various embodiments, graphics rendering may, at least in part, be implemented by program instructions that execute on one of, or parallel execution on two or more of, such GPUs. The GPU(s) may implement one or more application programmer interfaces (APIs) that permit programmers to invoke the functionality of the GPU(s). Suitable GPUs may be commercially available from vendors such as NVIDIA Corporation, ATI Technologies (AMD), and others.

System memory 1020 may store program instructions and/or data accessible by processor 1010. In various embodiments, system memory 1020 may be implemented using any suitable memory technology, such as static random access memory (SRAM), synchronous dynamic RAM (SDRAM), nonvolatile/Flash-type memory, or any other type of memory. In the illustrated embodiment, program instructions and data implementing desired functions, such as those described above are shown stored within system memory 1020 as program instructions 1025 and data storage 1035, respectively. In other embodiments, program instructions and/or data may be received, sent or stored upon different types of computer-accessible media or on similar media separate from system memory 1020 or computer system 2000. Generally speaking, a non-transitory, computer-readable storage medium may include storage media or memory media such as magnetic or optical media, e.g., disk or CD/DVD-ROM coupled to computer system 2000 via I/O interface 1030. Program instructions and data stored via a computer-readable medium may be transmitted by transmission media or signals such as electrical, electromagnetic, or digital signals, which may be conveyed via a communication medium such as a network and/or a wireless link, such as may be implemented via network interface 1040.

In one embodiment, I/O interface 1030 may coordinate I/O traffic between processor 1010, system memory 1020, and any peripheral devices in the device, including network interface 1040 or other peripheral interfaces, such as input/output devices 1050. In some embodiments, I/O interface 1030 may perform any necessary protocol, timing or other data transformations to convert data signals from one component (e.g., system memory 1020) into a format suitable for use by another component (e.g., processor 1010). In some embodiments, I/O interface 1030 may include support for devices attached through various types of peripheral buses, such as a variant of the Peripheral Component Interconnect (PCI) bus standard or the Universal Serial Bus (USB) standard, for example. In some embodiments, the function of I/O interface 1030 may be split into two or more separate components, such as a north bridge and a south bridge, for example. In addition, in some embodiments some or all of the functionality of I/O interface 1030, such as an interface to system memory 1020, may be incorporated directly into processor 1010.

Network interface 1040 may allow data to be exchanged between computer system 2000 and other devices attached to a network, such as other computer systems, or between nodes of computer system 2000. In various embodiments, network interface 1040 may support communication via wired or wireless general data networks, such as any suitable type of Ethernet network, for example; via telecommunications/telephony networks such as analog voice networks or digital fiber communications networks; via storage area networks such as Fibre Channel SANs, or via any other suitable type of network and/or protocol.

Input/output devices 1050 may, in some embodiments, include one or more display terminals, keyboards, keypads, touchpads, scanning devices, voice or optical recognition devices, or any other devices suitable for entering or retrieving data by one or more computer system 2000. Multiple input/output devices 1050 may be present in computer system 2000 or may be distributed on various nodes of computer system 2000. In some embodiments, similar input/output devices may be separate from computer system 2000 and may interact with one or more nodes of computer system 2000 through a wired or wireless connection, such as over network interface 1040.

As shown in FIG. 12, memory 1020 may include program instructions 1025, that implement the various methods and techniques as described herein, and data storage 1035, comprising various data accessible by program instructions 1025. In one embodiment, program instructions 1025 may include software elements of embodiments as described herein and as illustrated in the Figures. Data storage 1035 may include data that may be used in embodiments. In other embodiments, other or different software elements and data may be included.

Those skilled in the art will appreciate that computer system 2000 is merely illustrative and is not intended to limit the scope of the techniques as described herein. In particular, the computer system and devices may include any combination of hardware or software that can perform the indicated functions, including a computer, personal computer system, desktop computer, laptop, notebook, or netbook computer, mainframe computer system, handheld computer, workstation, network computer, a camera, a set top box, a mobile device, network device, internet appliance, PDA, wireless phones, pagers, a consumer device, video game console, handheld video game device, application server, storage device, a peripheral device such as a switch, modem, router, or in general any type of computing or electronic device. Computer system 2000 may also be connected to other devices that are not illustrated, or instead may operate as a stand-alone system. In addition, the functionality provided by the illustrated components may in some embodiments be combined in fewer components or distributed in additional components. Similarly, in some embodiments, the functionality of some of the illustrated components may not be provided and/or other additional functionality may be available.

Those skilled in the art will also appreciate that, while various items are illustrated as being stored in memory or on storage while being used, these items or portions of them may be transferred between memory and other storage devices for purposes of memory management and data integrity. Alternatively, in other embodiments some or all of the software components may execute in memory on another device and communicate with the illustrated computer system via inter-computer communication. Some or all of the system components or data structures may also be stored (e.g., as instructions or structured data) on a computer-accessible medium or a portable article to be read by an appropriate drive, various examples of which are described above. In some embodiments, instructions stored on a non-transitory, computer-accessible medium separate from computer system 2000 may be transmitted to computer system 2000 via transmission media or signals such as electrical, electromagnetic, or digital signals, conveyed via a communication medium such as a network and/or a wireless link. Various embodiments may further include receiving, sending or storing instructions and/or data implemented in accordance with the foregoing description upon a computer-accessible medium. Accordingly, the present invention may be practiced with other computer system configurations.

It is noted that any of the distributed system embodiments described herein, or any of their components, may be implemented as one or more web services. In some embodiments, a network-based service may be implemented by a software and/or hardware system designed to support interoperable machine-to-machine interaction over a network. A network-based service may have an interface described in a machine-processable format, such as the Web Services Description Language (WSDL). Other systems may interact with the web service in a manner prescribed by the description of the network-based service's interface. For example, the network-based service may define various operations that other systems may invoke, and may define a particular application programming interface (API) to which other systems may be expected to conform when requesting the various operations.

In various embodiments, a network-based service may be requested or invoked through the use of a message that includes parameters and/or data associated with the network-based services request. Such a message may be formatted according to a particular markup language such as Extensible Markup Language (XML), and/or may be encapsulated using a protocol such as Simple Object Access Protocol (SOAP). To perform a web services request, a network-based services client may assemble a message including the request and convey the message to an addressable endpoint (e.g., a Uniform Resource Locator (URL)) corresponding to the web service, using an Internet-based application layer transfer protocol such as Hypertext Transfer Protocol (HTTP).

In some embodiments, web services may be implemented using Representational State Transfer (“RESTful”) techniques rather than message-based techniques. For example, a web service implemented according to a RESTful technique may be invoked through parameters included within an HTTP method such as PUT, GET, or DELETE, rather than encapsulated within a SOAP message.

The various methods as illustrated in the FIGS. and described herein represent example embodiments of methods. The methods may be implemented in software, hardware, or a combination thereof. The order of method may be changed, and various elements may be added, reordered, combined, omitted, modified, etc.

Various modifications and changes may be made as would be obvious to a person skilled in the art having the benefit of this disclosure. It is intended that the invention embrace all such modifications and changes and, accordingly, the above description to be regarded in an illustrative rather than a restrictive sense. 

What is claimed is:
 1. A system, comprising: at least one processor; and a memory, storing program instructions that when executed cause the at least one processor to implement a primary processing cluster for a database; the primary processing cluster, configured to: receive a query to the database; responsive to a determination of an expected wait to perform the query at the primary processing cluster: classify performance of the query at the primary processing cluster according to a first prediction model for the primary processing cluster trained according to past query performance at the primary processing cluster to determine a first execution time prediction for the query at the primary processing cluster; classify performance of the query at a burst processing cluster according to a second prediction model for the burst processing cluster trained according to past query performance at the burst processing cluster to determine a second execution time prediction for the query at the burst processing cluster; select the burst processing cluster to perform the query according to a determination that the second execution time prediction is less than the first execution time prediction; and forward the query to the burst processing cluster to be performed with respect to the database.
 2. The system of claim 1, wherein the first execution time prediction for the query at the primary processing cluster includes an expected wait time at the primary processing cluster determined for the query.
 3. The system of claim 1, wherein to classify performance of the query at the primary processing cluster, the primary processing cluster is configured to identify a first predicted range of execution time that includes the first execution time prediction; wherein to classify performance of the query at the secondary processing cluster, the secondary processing cluster is configured to identify a second predicted range of execution time that includes the second execution time prediction; and wherein to determine that the second execution time prediction is less than the first execution time prediction compares a minimum value of the second predicted range of execution time that includes the second execution time prediction with a maximum value of the first predicted range of execution time that includes the first execution time.
 4. The system of claim 1, wherein the database is stored as a part of a network-based data warehouse service that implements the primary processing cluster and the burst processing cluster, wherein the burst processing cluster accesses a copy of the database stored in a storage service through a format-independent data processing service, and wherein the burst processing cluster is provisioned from a pool of processing clusters implemented for burst query processing.
 5. A method, comprising: receiving a query to a database at a first query engine; applying a first prediction model for the first query engine trained according to past query performance at the first query engine to determine a first execution time prediction for the query at the first query engine; applying a second prediction model for a second query engine trained according to past query performance at the second query engine to determine a second execution time prediction for the query at the second query engine; comparing the first execution time prediction with the second execution time prediction to determine that the second execution time prediction is less than the first execution time prediction; and sending the query to the second query engine to be performed with respect to the database.
 6. The method of claim 5, wherein applying the first prediction model for the first query engine trained according to past query performance at the first query engine to determine the first execution time prediction for the query at the first query engine comprises identifying a first predicted range of execution time that includes the first execution time prediction; wherein applying the second prediction model for the second query engine trained according to past query performance at the second query engine to determine the second execution time prediction for the query at the second query engine comprises identifying a second predicted range of execution time that includes the second execution time prediction; and wherein a minimum value of the second predicted range of execution time is the second execution time prediction and a maximum value of the first predicted range of execution time is the first execution time prediction that are compared to determine that the second execution time prediction is less than the first execution time prediction.
 7. The method of claim 5, further comprising determining an initialization time for provisioning the second query engine to include as part of the second predicted execution time when comparing the first predicted execution time with the second predicted execution time.
 8. The method of claim 5, further comprising: receiving a second query to the database at the first query engine; responsive to determining an expected wait time for the second query at the first query engine: applying the second prediction model for the second query engine trained according to past query performance at the second query engine to determine a third execution time prediction for the second query at the second query engine; comparing the third execution time prediction with an execution time threshold to determine that the third execution time prediction is greater than the execution time threshold; and performing the second query to the database at the second query engine.
 9. The method of claim 5, wherein performing the query at the second query engine comprises sending requests to access the database via format independent data service that accesses data of the database and returns results to the second query engine to complete the query.
 10. The method of claim 5, wherein the second query engine is one of a plurality of query engines that can perform queries to the database in addition to the first query engine, and wherein respective prediction models for the plurality of query engines are applied to determine respective execution time predictions for the query at the plurality of query engines, and wherein the method further comprises selecting the second query engine for comparison with the first query engine according to an evaluation of the respective execution time predictions.
 11. The method of claim 5, further comprising determining an expected wait time for the query at the first query engine to include as part of the first predicted execution time when comparing the first predicted execution time with the second predicted execution time.
 12. The method of claim 11, wherein determining the expected wait time for the query at the first query engine comprises: identifying those queries waiting at the first query engine classified in a same predicted range of execution time as the query; and applying a Markov decision process to a workload at the first query engine determined from a cumulative distribution function of the identified queries to estimate the expected wait time for the query.
 13. The method of claim 5, wherein the first query engine and the second query engine are implemented as part of a network-based service, and wherein the method further comprises provisioning the second query engine from a pool of query engines in response to determining that the second predicted execution time is less than the first predicted execution time, wherein the pool of query engines is implemented as part of the network-based service for burst query performance.
 14. One or more non-transitory, computer-readable storage media, storing program instructions that when executed on or across one or more computing devices cause the one or more computing devices to implement: receiving a query to a database at a first query engine; responsive to determining an expected wait time for the query at the first query engine: applying a first prediction model for the first query engine trained according to past query performance at the first query engine to determine a first execution time prediction for the query at the first query engine; applying a second prediction model for a second query engine trained according to past query performance at the second query engine to determine a second execution time prediction for the query at the second query engine; comparing the first execution time prediction with the second execution time prediction to determine that the second execution time prediction is less than the first execution time prediction; and sending the query to the second query engine to be performed with respect to the database.
 15. The one or more non-transitory, computer-readable storage media of claim 14, wherein the one or more non-transitory, computer-readable storage media further comprise program instructions to cause the one or more computing devices to implement determining an expected wait time for the query at the first query engine to include as part of the first predicted execution time when comparing the first predicted execution time with the second predicted execution time.
 16. The one or more non-transitory, computer-readable storage media of claim 14, wherein the one or more non-transitory, computer-readable storage media further comprise program instructions to cause the one or more computing devices to implement determining an initialization time for provisioning the second query engine to include as part of the second predicted execution time when comparing the first predicted execution time with the second predicted execution time.
 17. The one or more non-transitory, computer-readable storage media of claim 14, wherein the second query engine accesses a copy of the database stored at the second query engine to complete the query.
 18. The one or more non-transitory, computer-readable storage media of claim 14, wherein, in applying the first prediction model for the first query engine trained according to past query performance at the first query engine to determine the first execution time prediction for the query at the first query engine, the program instructions cause the one or more computing devices to implement identifying a first predicted range of execution time that includes the first execution time prediction; wherein, in applying the second prediction model for the second query engine trained according to past query performance at the second query engine to determine the second execution time prediction for the query at the second query engine, the program instructions cause the one or more computing devices to implement identifying a second predicted range of execution time that includes the second execution time prediction; and wherein a minimum value of the second predicted range of execution time is the second execution time prediction and a maximum value of the first predicted range of execution time is the first execution time prediction that are compared to determine that the second execution time prediction is less than the first execution time prediction.
 19. The one or more non-transitory, computer-readable storage media of claim 14, wherein the one or more non-transitory computer readable comprises further program instructions that when executed by the one or more computing devices cause the one or more computing devices to further implement: receiving a second query to the database at the first query engine; responsive to determining an expected wait time for the second query at the first query engine: applying the first prediction model for the first query engine trained according to past query performance at the first query engine to determine a third execution time prediction for the second query at the first query engine; applying the second prediction model for the second query engine trained according to past query performance at the second query engine to determine a fourth execution time prediction for the second query at the second query engine; comparing the third execution time prediction with the fourth execution time prediction to determine that the third execution time prediction is less than the fourth execution time prediction; and performing the second query to the database at the first query engine.
 20. The one or more non-transitory, computer-readable storage media of claim 14, wherein the database is stored as a part of a network-based data warehouse service that implements the first query engine and the second query engine and wherein the second query engine is provisioned from a pool of processing clusters implemented for burst query processing. 